﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="prop">
    <xs:complexType>
      <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
    </xs:complexType>
  </xs:element>
  <xs:element name="key">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="1" maxOccurs="unbounded" ref="prop" />
      </xs:sequence>
      <xs:attribute name="name" type="xs:string" />
      <xs:attribute default="false" name="ignoreIfNull">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="true" />
            <xs:enumeration value="false" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="message" type="xs:string" />
    </xs:complexType>
  </xs:element>
  <xs:element name="primaryKey">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="1" maxOccurs="unbounded" ref="prop" />
      </xs:sequence>
      <xs:attribute default="true" name="isObjectID">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="true" />
            <xs:enumeration value="false" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="add">
    <xs:complexType>
      <xs:attribute name="key" type="xs:NMTOKEN" use="required" />
      <xs:attribute name="value" type="xs:string" use="required" />
    </xs:complexType>
  </xs:element>
  <xs:element name="rule">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="add" />
      </xs:sequence>
      <xs:attribute name="name" type="xs:string" use="required" />
      <xs:attribute name="class" type="xs:string" />
      <xs:attribute name="assembly" type="xs:string" />
      <xs:attribute name="message" type="xs:string" />
    </xs:complexType>
  </xs:element>
  <xs:element name="databaseLookupList">
    <xs:complexType>
      <xs:attribute name="sql" type="xs:string" use="required" />
      <xs:attribute default="10000" name="timeout" type="xs:string" />
      <xs:attribute name="class" type="xs:NMTOKEN" />
      <xs:attribute name="assembly" type="xs:NMTOKEN" />
    </xs:complexType>
  </xs:element>
  <xs:element name="simpleLookupList">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="item" />
      </xs:sequence>
      <xs:attribute name="options" type="xs:string" />
    </xs:complexType>
  </xs:element>
  <xs:element name="item">
    <xs:complexType>
      <xs:attribute name="display" type="xs:string" use="required" />
      <xs:attribute name="value" type="xs:string" use="required" />
    </xs:complexType>
  </xs:element>
  <xs:element name="businessObjectLookupList">
    <xs:complexType>
      <xs:attribute name="class" type="xs:NMTOKEN" use="required" />
      <xs:attribute name="assembly" type="xs:NMTOKEN" use="required" />
      <xs:attribute name="criteria" type="xs:string" />
      <xs:attribute name="sort" type="xs:string" />
    </xs:complexType>
  </xs:element>
  <xs:element name="property">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="rule" />
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="databaseLookupList" />
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="simpleLookupList" />
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="businessObjectLookupList" />
      </xs:sequence>
      <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
      <xs:attribute name="displayName" type="xs:string" />
      <xs:attribute default="String" name="type" type="xs:string" />
      <xs:attribute default="System" name="assembly" type="xs:NMTOKEN" />
      <xs:attribute default="ReadWrite" name="readWriteRule">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="ReadWrite" />
            <xs:enumeration value="ReadOnly" />
            <xs:enumeration value="WriteOnce" />
            <xs:enumeration value="WriteNotNew" />
            <xs:enumeration value="WriteNew" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="databaseField" type="xs:string" />
      <xs:attribute name="default" type="xs:string" />
      <xs:attribute name="description" type="xs:string" />
      <xs:attribute default="false" name="compulsory">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="true" />
            <xs:enumeration value="false" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute default="false" name="autoIncrementing">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="true" />
            <xs:enumeration value="false" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="length" type="xs:string" />
      <xs:attribute default="false" name="keepValuePrivate">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="true" />
            <xs:enumeration value="false" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="relationship">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="1" maxOccurs="unbounded" ref="relatedProperty" />
      </xs:sequence>
      <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
      <xs:attribute name="type" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="single" />
            <xs:enumeration value="multiple" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute default="Association" name="relationshipType">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="Association" />
            <xs:enumeration value="Aggregation" />
            <xs:enumeration value="Composition" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute default="true" name="owningBOHasForeignKey">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="true" />
            <xs:enumeration value="false" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="relatedClass" type="xs:NMTOKEN" use="required" />
      <xs:attribute name="relatedAssembly" type="xs:NMTOKEN" use="required" />
      <xs:attribute default="true" name="keepReference">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="true" />
            <xs:enumeration value="false" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="reverseRelationship" type="xs:NMTOKEN" />
      <xs:attribute default="" name="orderBy" type="xs:string" />
      <xs:attribute default="Prevent" name="deleteAction">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="DeleteRelated" />
            <xs:enumeration value="DereferenceRelated" />
            <xs:enumeration value="Prevent" />
            <xs:enumeration value="DoNothing" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute default="InsertRelationship" name="insertAction">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="InsertRelationship" />
            <xs:enumeration value="DoNothing" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute default="" name="typeParameter" type="xs:string" />
      <xs:attribute default="0" name="timeout" type="xs:string" />
    </xs:complexType>
  </xs:element>
  <xs:element name="relatedProperty">
    <xs:complexType>
      <xs:attribute name="property" type="xs:NMTOKEN" use="required" />
      <xs:attribute name="relatedProperty" type="xs:NMTOKEN" use="required" />
    </xs:complexType>
  </xs:element>
  <xs:element name="superClass">
    <xs:complexType>
      <xs:attribute name="class" type="xs:NMTOKEN" use="required" />
      <xs:attribute name="assembly" type="xs:NMTOKEN" use="required" />
      <xs:attribute default="ClassTableInheritance" name="orMapping">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="ClassTableInheritance" />
            <xs:enumeration value="SingleTableInheritance" />
            <xs:enumeration value="ConcreteTableInheritance" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="id" type="xs:string" />
      <xs:attribute name="discriminator" type="xs:string" />
    </xs:complexType>
  </xs:element>
  <xs:element name="parameter">
    <xs:complexType>
      <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
      <xs:attribute name="value" type="xs:string" use="required" />
    </xs:complexType>
  </xs:element>
  <xs:element name="column">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="parameter" />
      </xs:sequence>
      <xs:attribute name="heading" type="xs:string" />
      <xs:attribute name="property" type="xs:string" use="required" />
      <xs:attribute name="type" type="xs:NMTOKEN" />
      <xs:attribute name="assembly" type="xs:NMTOKEN" />
      <xs:attribute default="true" name="editable">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="true" />
            <xs:enumeration value="false" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute default="100" name="width" type="xs:string" />
      <xs:attribute default="left" name="alignment">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="left" />
            <xs:enumeration value="right" />
            <xs:enumeration value="center" />
            <xs:enumeration value="centre" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="filterProperty">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="parameter" />
      </xs:sequence>
      <xs:attribute name="name" type="xs:NMTOKEN" />
      <xs:attribute name="label" type="xs:string" />
      <xs:attribute default="StringTextBoxFilter" name="filterType" type="xs:NMTOKEN" />
      <xs:attribute default="Habanero.UI.Base" name="filterTypeAssembly" type="xs:string" />
      <xs:attribute default="OpLike" name="operator">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="OpEquals" />
            <xs:enumeration value="OpLike" />
            <xs:enumeration value="OpGreaterThan" />
            <xs:enumeration value="OpGreaterThanOrEqualTo" />
            <xs:enumeration value="OpLessThan" />
            <xs:enumeration value="OpLessThanOrEqualTo" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="filter">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="1" maxOccurs="unbounded" ref="filterProperty" />
      </xs:sequence>
      <xs:attribute default="Filter" name="filterMode" type="xs:NMTOKEN" />
      <xs:attribute default="0" name="columns" type="xs:string" />
    </xs:complexType>
  </xs:element>
  <xs:element name="grid">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="1" ref="filter" />
        <xs:element minOccurs="1" maxOccurs="unbounded" ref="column" />
      </xs:sequence>
      <xs:attribute default="" name="sortColumn" type="xs:string" />
    </xs:complexType>
  </xs:element>
  <xs:element name="trigger">
    <xs:complexType>
      <xs:attribute name="triggeredBy" type="xs:NMTOKEN" />
      <xs:attribute name="conditionValue" type="xs:string" />
      <xs:attribute name="action" type="xs:NMTOKEN" use="required" />
      <xs:attribute name="value" type="xs:string" />
      <xs:attribute name="target" type="xs:NMTOKEN" />
    </xs:complexType>
  </xs:element>
  <xs:element name="field">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="parameter" />
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="trigger" />
      </xs:sequence>
      <xs:attribute name="label" type="xs:string" />
      <xs:attribute name="property" type="xs:NMTOKEN" use="required" />
      <xs:attribute name="type" type="xs:NMTOKEN" />
      <xs:attribute name="assembly" type="xs:NMTOKEN" />
      <xs:attribute name="mapperType" type="xs:NMTOKEN" />
      <xs:attribute name="mapperAssembly" type="xs:NMTOKEN" />
      <xs:attribute default="true" name="editable">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="true" />
            <xs:enumeration value="false" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="toolTipText" type="xs:string" />
      <xs:attribute default="Label" name="layout">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="Label" />
            <xs:enumeration value="GroupBox" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="columnLayout">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="1" maxOccurs="unbounded" ref="field" />
      </xs:sequence>
      <xs:attribute default="-1" name="width" type="xs:string" />
    </xs:complexType>
  </xs:element>
  <xs:element name="formGrid">
    <xs:complexType>
      <xs:attribute name="relationship" type="xs:NMTOKEN" use="required" />
      <xs:attribute name="reverseRelationship" type="xs:NMTOKEN" use="required" />
      <xs:attribute default="Habanero.UI.Win.EditableGridWin" name="type" type="xs:NMTOKEN" />
      <xs:attribute default="Habanero.UI.Win" name="assembly" type="xs:NMTOKEN" />
    </xs:complexType>
  </xs:element>
  <xs:element name="tab">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="columnLayout" />
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="field" />
        <xs:element minOccurs="0" maxOccurs="1" ref="formGrid" />
      </xs:sequence>
      <xs:attribute name="name" type="xs:string" use="required" />
    </xs:complexType>
  </xs:element>
  <xs:element name="form">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="tab" />
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="columnLayout" />
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="field" />
      </xs:sequence>
      <xs:attribute default="300" name="width" type="xs:string" />
      <xs:attribute default="250" name="height" type="xs:string" />
      <xs:attribute default="" name="title" type="xs:string" />
    </xs:complexType>
  </xs:element>
  <xs:element name="ui">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="1" ref="grid" />
        <xs:element minOccurs="0" maxOccurs="1" ref="form" />
      </xs:sequence>
      <xs:attribute default="default" name="name" type="xs:NMTOKEN" />
    </xs:complexType>
  </xs:element>
  <xs:element name="class">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="1" ref="superClass" />
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="property" />
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="key" />
        <xs:element minOccurs="0" maxOccurs="1" ref="primaryKey" />
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="relationship" />
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="ui" />
      </xs:sequence>
      <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
      <xs:attribute name="assembly" type="xs:NMTOKEN" use="required" />
      <xs:attribute name="table" type="xs:string" />
      <xs:attribute name="displayName" type="xs:string" />
      <xs:attribute name="typeParameter" type="xs:string" />
      <xs:attribute name="moduleName" type="xs:string" />
      <xs:attribute name="classID" type="xs:string" />
    </xs:complexType>
  </xs:element>
  <xs:element name="classes">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="1" maxOccurs="unbounded" ref="class" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>